#ifndef OBJECTMANAGER
#define OBJECTMANAGER

#include <allegro.h>
#include <list>
#include "Constants.hpp"
#include "Object.hpp"

typedef std::list<Object> ObjContainer; // DisplayManager uses this

class ObjectManager {
    public:
        ObjectManager();
        ~ObjectManager();
        void initObjects(const char* conf_file);
        void step();
        ObjContainer* getAllObjects();
        void changePrecisionBy(float r);
        float getTimeYears();
    private:
        ObjContainer objs;
        void COMCenteringCorrection();
        void Collide(ObjContainer::iterator obj1, ObjContainer::iterator obj2);
        double dt;
        double elapsed_time; // seconds; double in order to avoid overflow
};

#endif
